Hello, I received one response to my problem listed in the original message below. Great thanks to Craig Hanson who told me that my problem might be because I was adding the same field list to numerous Vtabs in a loop. ArcView does not like this and it was causing the crash of ArcView when I tried to open the tables. Craig suggested I use the .DeepClone request on the field list as shown below and this worked. for each fname in fnList theVTab = vtab.MakeNew(fname, dBASE) theVTab.AddFields(fieldList.deepclone) '************* theTable = Table.Make(theVtab) theTable.SetName(fname.AsString.BasicTrim(thewd.AsString + "\", "")) end Original Message: Hello again, I have a situation in which I create some new tables and add them to the project and then do some processing with those tables in a for each loop. When I go to open the tables after the processing ArcView shuts down. For a very brief moment a dos screen comes up but I can't see what it says. A nd.dbg file is created in the directory where the files for the tables are stored. At the bottom of the nd.dbg file it says 'FATAL ERROR Failure during error recovery'. I don't know if this important but I get the feeling it is. The script is below. This is just a simplified script. My real script is more complicated and it does a series of operations using four sets of 52 grids (weekly). Basically the script creates two new tables. Then in the loop it does some calculations for the grids and then uses the ZonalStatsTable to calculate statistics. The tables that were created before the loop are meant to take the values from the stats table and combine them into one so I don't end up with a different table for every week. This seems to work. However then when I try to open the tables it crashes ArcView. The last table (finaltable) in the loop can be opened ok. The ones before that can't be opened. Any ideas? Also in the loop I want to delete all of the tables that were created using the ZonalStatsTable. when i tried to do this I get an error message 'Error calling unlink for file , Returned error code 13'. I know I have to remove all the refernces to the table but how do I do that exactly? This part is commented out at the end. Thank you very much if anyone can help out. theview = av.GetActiveDoc '--------------------------- theProject = av.GetProject thewd = theProject.GetWorkDir thewd.SetCWD simName = "lyon_2" 'Create a set of tables which will hold the summary statistics '------------------------------------- afname1 = (thewd.AsString + "\SumQs_" + simName).AsFileName afname2 = (thewd.AsString + "\SumQgw_" + simName).AsFileName fnList = {afname1, afname2} 'make fields f1 = Field.Make("Value", #FIELD_DECIMAL, 11, 0) f2 = Field.Make("Week_Num", #FIELD_DECIMAL, 4, 0) fieldList = {f1, f2} 'make the vtab and add tables to project for each fname in fnList theVTab = vtab.MakeNew(fname, dBASE) theVTab.AddFields(fieldList) theTable = Table.Make(theVtab) theTable.SetName(fname.AsString.BasicTrim(thewd.AsString + "\", "")) end maskG = theView.findTheme("Lyon_catch").GetGrid maskVTab = maskG.GetVTab zoneField = maskVTab.FindField("Value") num = 100 for each week in 1..3 aS1 = "Qs_"+week.AsString aFn1 = aS1.AsFileName aS2 = "Qgw_"+week.AsString aFn2 = aS2.AsFileName sflowG = 1.AsGrid * num.AsGrid gwflowG = 2.AsGrid * num.Asgrid sflowVTab = sflowG.ZonalStatsTable(maskG,Prj.MakeNull,zonefield,False,aFn1) gwflowVTab = gwflowG.ZonalStatsTable(maskG,Prj.MakeNull,zonefield,False,aFn2) num = num + 100 'list of stats vtabs vtabList = {sflowVTab, gwflowVTab} afnList = {aFn1, aFn2} for each vt in VtabList 'get the name of the table vtabName = vt.GetName theNum = vtabName.IndexOf("_") thecount = VTabName.Count newNameNum = theCount - (theCount - theNum) newName = vtabName.Left(newNameNum) findString = "Sum" + newName + "_" + simName 'get the value to add to sum table valueField = vt.FindField("Value") valueVal = vt.ReturnValue(valueField, 0) 'get the table that was created earlier finalTable = theProject.FindDoc(findString) finalVTab = finalTable.GetVTab finalVTab.StartEditingWithRecovery recNo = finalVTab.AddRecord finalVTab.SetValue(f1, recNo, valueVal) finalVTab.SetValue(f2, recNo, week) finalVTab.StopEditingWithRecovery(true) end 'filenum = 0 'for each vt in vtabList ' vt = nil 'av.purgeObjects 'delFn = aFnList.Get(fileNum) 'delFN = thewd.AsString + "\" delFN.AsString 'file.Delete(delFn.AsFileName) 'fileNum = fileNum + 1 'end end John DeGroote GIS and Data Services The Macaulay Institute Craigiebuckler Aberdeen Scotland UK AB15 8QH Tel: +(44) (0) 1224 498200 Fax: +(44) (0) 1224 311556 email: j.degroote@macaulay.ac.uk http://macaulay.ac.uk